home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Software Vault: The Gold Collection
/
Software Vault - The Gold Collection (American Databankers) (1993).ISO
/
cdr52
/
clpshare.zip
/
SHARE.C
next >
Wrap
Text File
|
1993-04-20
|
2KB
|
44 lines
/****************************************************************************
* Program........: SHARE.C (Clipper Function) *
* Author.........: Scott C. Hansen *
* Date...........: 06/07/88 *
* Version........: 1.0 *
* Notes..........: Flags file as shareable under the Novell Netware *
* : shell. *
* Returns........: A logical is ret if file is changed or already *
* : flagged as shareable. *
****************************************************************************/
#include <nandef.h>
#include <extend.h>
#include <dos.h>
#include <io.h>
#define SHAREABLE 0X80 /* Bit mask for the 7th bit (2 to the 7th) */
CLIPPER share()
{
char *fname[1]; /* File name pointer */
unsigned attribute; /* File attribute flag */
int fh; /* File handle */
int fflag; /* Clipper Boolean */
fflag=1; /* Initialize as True */
fname[0]=_parc(1); /* File name from Clipper */
if ((access(fname[0],00)) == -1) /* Check if file exists */
fflag=0; /* If not flag as False */
if (fflag ==1) { /* If file exists go to work */
_dos_setfileattr(fname[0],SHAREABLE); /* Flag the 7th bit ON,
shareable */
_dos_getfileattr(fname[0],&attribute);
/* Capture current attribute */
if ((attribute & SHAREABLE) != 0)
/* Exclusive AND to test change */
fflag=1; /* Attrib. changed, return True */
else
fflag=0; /* Not changes, return False */
}
_retl(fflag); /* Return boolean to Clipper */
_ret();
}